#pragma once

#define		ELEMENT_TREE_ROOT_NODE	0
#define		ELEMENT_TREE_ELEMENT_NODE	1
#define		ELEMENT_TREE_SUBE_NODE	2
#define		ELEMENT_TREE_ITEM_NODE	4
#define		ELEMENT_TREE_OPER_NODE	3

// CElementTreeCtrl

class CElementTreeCtrl : public CTreeCtrl
{
	DECLARE_DYNAMIC(CElementTreeCtrl)

public:
	CElementTreeCtrl();
	virtual ~CElementTreeCtrl();

protected:
	CImageList		m_il;
	BOOL			m_isEditable;

public:
	void	AttachBitmap();
	void	Populate(BOOL bIsShowAll=TRUE);

	void	SetEditable(BOOL bEditable);
	BOOL	IsEditable();

protected:
	BOOL	PopulateSubElement(z_uint32 nParentCode, HTREEITEM hParentItem, BOOL bIsShowAll = TRUE);
	BOOL	PopulateItem(z_uint32 nParentCode, HTREEITEM hParentItem, BOOL bIsShowAll=TRUE);

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};


